/**
 * @param {() => void} fn
 * @param {number} deny
 * @returns {Promise<void>}
 */
function awaitTimeout(fn, deny) {
  return new Promise((resolve) => {
    setTimeout(() => {
      fn();
      resolve();
    }, deny);
  });
}

module.exports = { awaitTimeout };
